//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#include "AddressReuseMode.h"

#include "UtilityFunctions.h"

/*!
  \file AddressReuseMode.cc
  \brief Code supporting tracking which address reuse types are enabled.
*/

namespace Green {

  AddressReuseMode::AddressReuseMode()
    : mModeBits(0)
  {
  }

  AddressReuseMode::AddressReuseMode(const AddressReuseMode& rOther)
    : mModeBits(rOther.mModeBits)
  {
  }

  void AddressReuseMode::DisableAllReuseTypes()
  {
    mModeBits = 0;
  }

  bool AddressReuseMode::IsReuseTypeEnabled(const EAddressReuseType addrReuseType) const
  {
    EAddressReuseTypeBaseType addrReuseTypeValue = EAddressReuseTypeBaseType(addrReuseType);
    return ((mModeBits & addrReuseTypeValue) == addrReuseTypeValue);
  }

}
